class Animal {
  /**
   * 静态方法
   * @param a
   */
  public static isAnimal(a){
    return a instanceof Animal;
  }
}

//调用
let cat = new Animal();
Animal.isAnimal(cat);

class Dog {
  //静态属性
  static age = 20;
}

console.log(Dog.age);

class Fish {
  private name; //私有的外部不能获取
  public age;
  //构造函数
  public constructor(name,age){
    this.name = name;
    this.age = age;
  }
}

let fish = new Fish("鲤鱼",2);
console.log(fish.age);
//console.log(fish.name);  //不能获取

/**
 * 抽象类 (不能实例化，一般用于继承实现)
 */
abstract class Pig {
  public name;
  constructor(name){
    this.name = name;
  }
  public abstract eat();
}

//实现抽象类
class PinkPig extends Pig{
  eat() {
    console.log("粉色小猪");
  }
}

